package com.it.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.it.pojo.User;
import com.it.pojo.vo.AdminUserVO;
import com.it.pojo.vo.user.UserCenterVO;
import com.it.pojo.vo.user.UserFollowVO;
import com.it.pojo.vo.user.UserInfoVO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @Author
 * @Date 2022/1/14 21:24
 * @Version 1.0
 */
@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 后台管理用户条件查询
     *
     * @param nickname
     * @param status
     * @param firstDate
     * @param lastDate
     * @param start
     * @param limit
     * @return
     */
    List<User> listUser(@Param("nickname") String nickname
            , @Param("status") Integer status, @Param("firstDate") String firstDate,
                        @Param("lastDate") String lastDate,
                        @Param("start") Integer start,
                        @Param("limit") Integer limit
    );

    int listUserTotal(
            @Param("nickname") String nickname
            , @Param("status") Integer status, @Param("firstDate") String firstDate,
            @Param("lastDate") String lastDate
    );

    UserInfoVO getUserByToken(@Param("token") String token);

    /**
     * 通过粉丝用户id获取用户信息
     *
     * @param list
     * @return
     */
    List<UserFollowVO> listUserFansByInUserId(@Param("list") List<Integer> list);

    /**
     * 获取个人中心数据
     *
     * @param userId
     * @return
     */
    UserCenterVO getUserCenterVO(@Param("userId") Integer userId);
}
